UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DpXBt6cF0Q0LNoda0u41axWd2sA099oa3GMR/h3dvN0=' 
WHERE 
  key_id = '2808b30dd328b477e27d08cfb29c73003efd3f895e56248fb29da00f08a88c27' 
  AND (
    token = 'DpXBt6cF0Q0LNoda0u41axWd2sA099oa3GMR/h3dvN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043