UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q+F2m0qob2LLZdY/ACoMtfEQQsH2+bHm+Y/spvPr4LM=' 
WHERE 
  key_id = 'a648a7a1b94eaf33d84119f916a13ade3e50a8e075a0fcd0049ddeacd4f02e56' 
  AND (
    token = 'Q+F2m0qob2LLZdY/ACoMtfEQQsH2+bHm+Y/spvPr4LM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00011