UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lkqG0elXsrmNRY2FVaXdiuZ6g7oSZh1spW8Tys8wLMc=' 
WHERE 
  key_id = 'b84e461fbb294c351d4413dd6c0a0236ce1023098f7e6ec4d21329d9aca09643' 
  AND (
    token = 'lkqG0elXsrmNRY2FVaXdiuZ6g7oSZh1spW8Tys8wLMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034