UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KJ6e9RFzuYuSnA1S8mvItUR9DdkeRk7gDof0QLmm7Xg=' 
WHERE 
  key_id = 'e2e7ca0c92320136a445df59aa30f355b6d2565cdfa5f035a72b3726bc280f16' 
  AND (
    token = 'KJ6e9RFzuYuSnA1S8mvItUR9DdkeRk7gDof0QLmm7Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029