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

Query time 0.00039