UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J1xK9q2ToBUzX/IgwvXZLgOK1pKtLsCAsBQ2DLTPwoI='
WHERE
key_id = 'e076ceadbba06b074e55c1fe73b2801f190c9c3382c55d173023c6349379004a'
AND (
token = 'J1xK9q2ToBUzX/IgwvXZLgOK1pKtLsCAsBQ2DLTPwoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)