UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+T5ZpYWPaAV/Cg2S9NPH658L9H9v8emlwmtWfSepePg=' 
WHERE 
  key_id = 'a558d7cce2db1ac5980e0963d45d645e5de22d3f5b9e7cfd7dcd94303d2f64dc' 
  AND (
    token = '+T5ZpYWPaAV/Cg2S9NPH658L9H9v8emlwmtWfSepePg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033