UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4VhHNVrgewFB0NQBJInoGZEx1SHxJPg0V3aV3eXOMXc=' 
WHERE 
  key_id = '97f4ffefbe5bdbb37158562bc3da0e5499dea334f945c908dfdf01644746e58e' 
  AND (
    token = '4VhHNVrgewFB0NQBJInoGZEx1SHxJPg0V3aV3eXOMXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019