UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0/DN2AObYPxW8bTr5cnKtiT4EWUHgj2HUg/F54HYLL4='
WHERE
key_id = 'ca511e5792c42d9eaab42c603fc619470916e76110e00b36918c9dc16b54aa76'
AND (
token = '0/DN2AObYPxW8bTr5cnKtiT4EWUHgj2HUg/F54HYLL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)