UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uRZYW5GsKc0trhGLtnDaY2vRhiCpmPpgNwNQCRyLj/0=' 
WHERE 
  key_id = '14910b1ed2b78af559c9b18e346586fc3b84bf853f30aa169ae34326afe76998' 
  AND (
    token = 'uRZYW5GsKc0trhGLtnDaY2vRhiCpmPpgNwNQCRyLj/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028