UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E/J8L/4S/jBidnfHpIN1ADdLylMrr6T2oM/Pa8U5QE8='
WHERE
key_id = 'd9df48ec456f0360d32b55e19f4d9cc64634c72fb81682683a39d8c231f40dc2'
AND (
token = 'E/J8L/4S/jBidnfHpIN1ADdLylMrr6T2oM/Pa8U5QE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)