UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't7F4pOfHjzF1AnVXp4op+4xjlltnO6z3IKVEhhEZajU=' 
WHERE 
  key_id = '42b68349e04f67b172bccfe9140915417056286e347febd39b5a9aec4b6f5a0a' 
  AND (
    token = 't7F4pOfHjzF1AnVXp4op+4xjlltnO6z3IKVEhhEZajU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026