UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zVzMDRdlZlG3kiXjGzpq59HG2LVRdeaU9fGsrQc87Vc='
WHERE
key_id = 'bb90d3db40a9f7273a53e71f889e705ec0e620fae18eebede332981c67df5758'
AND (
token = 'zVzMDRdlZlG3kiXjGzpq59HG2LVRdeaU9fGsrQc87Vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)