UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uYzZjF9o4kKAxP1d20y6zrVHAurGmt7stVv+KPoN4c='
WHERE
key_id = '1a3bcfc36ca49f0060f136cf7a91b62ca1af3e03dec4116216ff7d8a77991056'
AND (
token = '1uYzZjF9o4kKAxP1d20y6zrVHAurGmt7stVv+KPoN4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)