UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TehwcZwW9AYTUN8OkvBQydgOYdkW84uFS41bBUt0e8A='
WHERE
key_id = '1f5453331d4fac87481f471d18dc7cbdf0d187aa59fecae5502207fd223e0aed'
AND (
token = 'TehwcZwW9AYTUN8OkvBQydgOYdkW84uFS41bBUt0e8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)