UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iSl1dFhqP5mndX/O4ZtblOhklac15b/LjURcXhEYcLA=' 
WHERE 
  key_id = '879f7e45689bf5d064206400ee616a7d5b42d8a2dbf6f5aa6ee419237f37cd38' 
  AND (
    token = 'iSl1dFhqP5mndX/O4ZtblOhklac15b/LjURcXhEYcLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028