UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qmu33WCYnpreO6AHYCM37Gt7jCPPVqau/SagLmAnt0o='
WHERE
key_id = '0d60a92450c3f7a2b4f40ef8681a183f9310d317eb119a56fdcbd20496603544'
AND (
token = 'qmu33WCYnpreO6AHYCM37Gt7jCPPVqau/SagLmAnt0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)