UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6cOjn4l4gBF6HYecqsAGA/R5Jaj/VTchMiQPKrmPd0='
WHERE
key_id = '0302d6763f0eee597577c46cf543bb30b8d746d29cae898dc7651358cf0dd847'
AND (
token = 'p6cOjn4l4gBF6HYecqsAGA/R5Jaj/VTchMiQPKrmPd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)