UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NqRcTKjz9PjnBhhvsd//mRZ9VJWDYtTrta7R1QvkgQQ='
WHERE
key_id = 'e1a8a17aac4efd822e69f69cdd5bfaf432753a77df0ea8b4e8228be327dcc25e'
AND (
token = 'NqRcTKjz9PjnBhhvsd//mRZ9VJWDYtTrta7R1QvkgQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)