UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p0hP3bq/0CqYOMz8IxPXbLwS7mxazpIta57DWC/Y68g='
WHERE
key_id = 'c6a4b3180ed78661b1d5f2beae2f15774068ef619f876fbf1c0fddcf9bd5aeb9'
AND (
token = 'p0hP3bq/0CqYOMz8IxPXbLwS7mxazpIta57DWC/Y68g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)