UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vd+25QSvYKO30x0rxEX/Jnb3Htw5rQyeOIbjMm3jGg4=' 
WHERE 
  key_id = '9d9e3e84ada41a3c39e96719a3c8fbecf61a497f6549cfcac5cd1b51665ed25d' 
  AND (
    token = 'vd+25QSvYKO30x0rxEX/Jnb3Htw5rQyeOIbjMm3jGg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033