UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5o6hr40siWyMOBk5UnkGF8tZ31xHHAJx6OZEOkd23JM='
WHERE
key_id = 'b0f5016c99d858140adaa64d5f99fb00398c974b9e8d359f5a19bf05fa27821d'
AND (
token = '5o6hr40siWyMOBk5UnkGF8tZ31xHHAJx6OZEOkd23JM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)