UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DCOc+oSGq9iFHWUF18w4l5Ql6l+FMNNPsG40expmNi8='
WHERE
key_id = '4cc7847f4a62b4a2fdd58d87802b290c467e672f5b875969f7cda352915f4c62'
AND (
token = 'DCOc+oSGq9iFHWUF18w4l5Ql6l+FMNNPsG40expmNi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)