UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pUzHH8ICarQFPuXpzMfWLK4QSLzzbK7DxnYgkkgIBok='
WHERE
key_id = 'ceaba856bfebecb5db9ffdd4b9eac52cf36c762caa5ef1bc7c92d3987b1269e9'
AND (
token = 'pUzHH8ICarQFPuXpzMfWLK4QSLzzbK7DxnYgkkgIBok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)