UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TqidCZAsEj1H9NRTZCCe2/ct1pIeQ5VK/Vnyko8+1WU='
WHERE
key_id = 'cce180d565ea3067e2d70fb8338f437347042183bc790b277464a05113606bae'
AND (
token = 'TqidCZAsEj1H9NRTZCCe2/ct1pIeQ5VK/Vnyko8+1WU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)