UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FkNI+bjbhgXXVbizk6/8i4Py9fXZCESioH/eI1m6oLQ='
WHERE
key_id = 'bba99fa1e2ab029df4e8150946900041d27efe3f7ec76458b0e05d3ec9254e1f'
AND (
token = 'FkNI+bjbhgXXVbizk6/8i4Py9fXZCESioH/eI1m6oLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)