UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7U/E04TsacAyQAQADCAOjgekhDvmlLHD6pSIXlOrIwA=' 
WHERE 
  key_id = '6a9738722a5004f9fc3934886d49aab82b0c66b151526408e226587f75b7cab7' 
  AND (
    token = '7U/E04TsacAyQAQADCAOjgekhDvmlLHD6pSIXlOrIwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031