UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VfHqDLHpuqJtG2P1KhNMAWKz09ERy582M6vA9F+N7xA=' 
WHERE 
  key_id = '2435ebbaad200b341adea065d936bf391415249bd1ff2e1c166d9fccacda92a1' 
  AND (
    token = 'VfHqDLHpuqJtG2P1KhNMAWKz09ERy582M6vA9F+N7xA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049