UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zlxj57yWvtljMHI2/y7M3YYWm1P+AFyTrMEiIa5qFYI='
WHERE
key_id = 'b9b9228ecd5c82dae79ad051e88e64deb2da54a7277c711b6639b879f892cde9'
AND (
token = 'Zlxj57yWvtljMHI2/y7M3YYWm1P+AFyTrMEiIa5qFYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)