UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q2R2i7sarKz7l4l/zGSFtGXZXU3T75oTFNl09fryNy0='
WHERE
key_id = '0fa3a8f1bf230963e1247ef827e3251d40cd9b8d44b59b4b0e22c062901d9749'
AND (
token = 'q2R2i7sarKz7l4l/zGSFtGXZXU3T75oTFNl09fryNy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)