UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cxeJeKkRTrAxBuKt6CSgtrivVOGhbZ+z1kbHoWRDhVY=' 
WHERE 
  key_id = '13aa15483d910c15d142399ae15f5c9c97728d1c110e36001dde763b1a136f23' 
  AND (
    token = 'cxeJeKkRTrAxBuKt6CSgtrivVOGhbZ+z1kbHoWRDhVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071