UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SypyrFe1WllBRQztZK1fEP2WN/2BAekEbA4Qo4ssas8='
WHERE
key_id = 'c184d3416d92d1f798bfe2650fb1652a8900435ef0f82ffd8dc30bf0dc86b8e7'
AND (
token = 'SypyrFe1WllBRQztZK1fEP2WN/2BAekEbA4Qo4ssas8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)