UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3narpIsNm3RuRCpx4gCawLhx6wFEwOmblXsv18fgSDw=' 
WHERE 
  key_id = '5457f5a6c76cb2a178a2803309845d4008ad3870b47fc0b29d34f255baa9317f' 
  AND (
    token = '3narpIsNm3RuRCpx4gCawLhx6wFEwOmblXsv18fgSDw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028