UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxvW3wKP7RJiVZ/GJQoNPRkuiYUEk5rCMHVOgT6oXCw='
WHERE
key_id = '2fda0ecda0e16db692ab0593869a6c4705383b9c4f519b0701dd63bf3960b0dd'
AND (
token = 'nxvW3wKP7RJiVZ/GJQoNPRkuiYUEk5rCMHVOgT6oXCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)