UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B0EIulIuAKDliZV/syD5cQbVfSmlHrl/q1PlVCbi02k='
WHERE
key_id = '4886a890091a1f3213ab50193befb9e26fb6d732576ebd7973a4bc39d443627c'
AND (
token = 'B0EIulIuAKDliZV/syD5cQbVfSmlHrl/q1PlVCbi02k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)