UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VqhsuqEWZc6MpZ7wnK6X7GYmtvk3YqgY9NPVQLxitGE='
WHERE
key_id = '1341b16246141b4365867b7fe1112700de75f9ebe66afae853af04aea9430591'
AND (
token = 'VqhsuqEWZc6MpZ7wnK6X7GYmtvk3YqgY9NPVQLxitGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)